<template>
  <div>
    <div class="weekend-title">周末去哪儿</div>
    <ul>
      <li class="item" v-for="item of list" :key="item.id">
        <!-- 一般给一个图片包裹一个 div 是为了干嘛 -->
        <div class="item-img-wrapper">
          <img class="item-img" :src="item.imgUrl" />
        </div>
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'homeRest',
  props: {
    list: Array
  }
}
</script>

<style scoped>
  .weekend-title {
    line-height: 32px;
    height: 32px;
    background: #eee;
    text-indent: 10px;
    font-size: 14px;
  }
  .item-img-wrapper {
    overflow: hidden;
    height: 0;
    padding-bottom: 33.9%;
  }
  .item-img {
    width: 100%;
  }
  .item-info {
    padding: 5px;
    /* min-width: 0; */
  }
  .item-title {
    line-height: 27px;
    font-size: 16px;
  }
  .item-desc {
    line-height: 20px;
    color: #ccc;
  }
</style>
